package DesignPatern.A08_调停者模式.A002_调停者模式解决;

/**
 * @Author: Du
 * @Date: 2021/7/23 11:41
 *
 * 用一个中间对象封装一系列的对象交互，中介者使得各个对象不需要相互作用。从而使其耦合松散，可以独立地改变它们间的交互
 *
 */
public class A01_Main
{
    public static void main(String[] args)
    {
        AbstractMediator mediator = new Mediator();
    
        Stock stock = new Stock(mediator);
        stock.getNumber();
        
        Purchase purchase = new Purchase(mediator);
        purchase.buyComputer(100);

        Sale sale = new Sale(mediator);
        sale.sellIBM(30);
        sale.OffSale();

        stock.clearStock();
    }
}
